package zhr;

public class ex3_6 {
    public static void main(String[] args) {
        System.out.println("** while 语句 **");
        int n=10,sum=0;
        while (n>0){
            sum+=n;
            n--;
        }
        System.out.println("sum is " + sum);
        System.out.println("** do_while 语句 **");
        n=0; sum=0;
        do{
            sum+=n;
            n++;
        }while (n<=10);{
            System.out.println("sum is " + sum);
            System.out.println("** for 语句 **");
            sum =0;
            for (int i=1;i<=10;i++){
                sum+=i;
            }
            System.out.println("sum is " + sum);
        }
    }
}
